<?php

// require_once 'Zend/Gdata/Extension.php';
require_once dirname(__FILE__) . '/../../Extension/Params.php';
require_once dirname(__FILE__) . '/TextValues.php';

class Rats_Extension_JobParams extends Raws_Extension_Params
{

    // protected $_rootNamespace = 'raws';
    // protected $_rootElement = 'params';
 
    protected $_id = null;
    protected $_status = null;
    protected $_input = null;
    protected $_output = null;
    protected $_format = null;
    protected $_src_location = null;
    protected $_import_location = null;
    protected $_tgt_location = null;
    protected $_startpos = null;
    protected $_endpos = null;
    protected $_client_passthru = null;
    protected $_client_input = null;
    protected $_transc = null;
    protected $_transc_media = null;
    protected $_video_bitrate = null;
    protected $_audio_bitrate = null;
    protected $_video_width = null;
    protected $_video_height = null;
    protected $_proc = null;

    public function __construct($status = null, $input = null, $output = null, $format = null, $src_location = null, $import_location = null) 
    {
        // foreach (Rats::$namespaces as $nsPrefix => $nsUri) {
        //     $this->registerNamespace($nsPrefix, $nsUri);
        // }
        parent::__construct();
        $this->_status = $status;
        $this->_input = $input;
        $this->_output = $output;
        $this->_format = $format;
        $this->_src_location = $src_location;
        $this->_import_location = $import_location;
    }
    
    /**
     * Retrieves a DOMElement which corresponds to this element and all
     * child properties.  This is used to build an entry back into a DOM
     * and eventually XML text for application storage/persistence.
     *
     * @param DOMDocument $doc The DOMDocument used to construct DOMElements
     * @return DOMElement The DOMElement representing this element and all
     *          child properties.
     */
    public function getDOM($doc = null)
    {
        $element = parent::getDOM($doc);
        if ($this->_id !== null) {
            $element->appendChild($this->_id->getDOM($element->ownerDocument));
        }
        if ($this->_status !== null) {
            $element->appendChild($this->_status->getDOM($element->ownerDocument));
        }
        if ($this->_input !== null) {
            $element->appendChild($this->_input->getDOM($element->ownerDocument));
        }
        if ($this->_output !== null) {
            $element->appendChild($this->_output->getDOM($element->ownerDocument));
        }
        if ($this->_format !== null) {
            $element->appendChild($this->_format->getDOM($element->ownerDocument));
        }
        if ($this->_src_location !== null) {
            $element->appendChild($this->_src_location->getDOM($element->ownerDocument));
        }
        if ($this->_import_location !== null) {
            $element->appendChild($this->_import_location->getDOM($element->ownerDocument));
        }
        if ($this->_tgt_location !== null) {
            $element->appendChild($this->_tgt_location->getDOM($element->ownerDocument));
        }
        if ($this->_startpos !== null) {
            $element->appendChild($this->_startpos->getDOM($element->ownerDocument));
        }
        if ($this->_endpos !== null) {
            $element->appendChild($this->_endpos->getDOM($element->ownerDocument));
        }
        if ($this->_client_passthru !== null) {
            $element->appendChild($this->_client_passthru->getDOM($element->ownerDocument));
        }
        if ($this->_client_input !== null) {
            $element->appendChild($this->_client_input->getDOM($element->ownerDocument));
        }
        if ($this->_transc !== null) {
            $element->appendChild($this->_transc->getDOM($element->ownerDocument));
        }
        if ($this->_transc_media !== null) {
            $element->appendChild($this->_transc_media->getDOM($element->ownerDocument));
        }
        if ($this->_video_bitrate !== null) {
            $element->appendChild($this->_video_bitrate->getDOM($element->ownerDocument));
        }
        if ($this->_audio_bitrate !== null) {
            $element->appendChild($this->_audio_bitrate->getDOM($element->ownerDocument));
        }
        if ($this->_video_height !== null) {
            $element->appendChild($this->_video_height->getDOM($element->ownerDocument));
        }
        if ($this->_video_width !== null) {
            $element->appendChild($this->_video_width->getDOM($element->ownerDocument));
        }
        if ($this->_proc !== null) {
            $element->appendChild($this->_proc->getDOM($element->ownerDocument));
        }
        
        return $element;
    }

    /**
     * Creates individual Entry objects of the appropriate type and
     * stores them as members of this entry based upon DOM data.
     *
     * @param DOMNode $child The DOMNode to process
     */
    protected function takeChildFromDOM($child)
    {
        $absoluteNodeName = $child->namespaceURI . ':' . $child->localName;
        
        switch ($absoluteNodeName) {
            case $this->lookupNamespace('raws') . ':' . 'id'; 
                $id = new Rats_Extension_Status();
                $id->transferFromDOM($child);
                $this->_id = $id;
                break;
            case $this->lookupNamespace('raws') . ':' . 'status'; 
                $status = new Rats_Extension_Status();
                $status->transferFromDOM($child);
                $this->_status = $status;
                break;
            case $this->lookupNamespace('raws') . ':' . 'input'; 
                $input = new Rats_Extension_Input();
                $input->transferFromDOM($child);
                $this->_input = $input;
                break;
            case $this->lookupNamespace('raws') . ':' . 'output'; 
                $output = new Rats_Extension_Output();
                $output->transferFromDOM($child);
                $this->_output = $output;
                break;
            case $this->lookupNamespace('raws') . ':' . 'format'; 
                $format = new Rats_Extension_Format();
                $format->transferFromDOM($child);
                $this->_format = $format;
                break;
            case $this->lookupNamespace('raws') . ':' . 'src_location'; 
                $src_location = new Rats_Extension_SrcLocation();
                $src_location->transferFromDOM($child);
                $this->_src_location = $src_location;
                break;
            case $this->lookupNamespace('raws') . ':' . 'import_location'; 
                $import_location = new Rats_Extension_ImportLocation();
                $import_location->transferFromDOM($child);
                $this->_import_location = $import_location;
                break;
            case $this->lookupNamespace('raws') . ':' . 'tgt_location'; 
                $tgt_location = new Rats_Extension_TgtLocation();
                $tgt_location->transferFromDOM($child);
                $this->_tgt_location = $tgt_location;
                break;
            case $this->lookupNamespace('raws') . ':' . 'startpos'; 
                $startpos = new Rats_Extension_Startpos();
                $startpos->transferFromDOM($child);
                $this->_startpos = $startpos;
                break;
            case $this->lookupNamespace('raws') . ':' . 'endpos'; 
                $endpos = new Rats_Extension_Endpos();
                $endpos->transferFromDOM($child);
                $this->_endpos = $endpos;
                break;
            case $this->lookupNamespace('raws') . ':' . 'client_passthru'; 
                $client_passthru = new Rats_Extension_ClientPassthru();
                $client_passthru->transferFromDOM($child);
                $this->_client_passthru = $client_passthru;
                break;
            case $this->lookupNamespace('raws') . ':' . 'client_input'; 
                $client_input = new Rats_Extension_ClientInput();
                $client_input->transferFromDOM($child);
                $this->_client_input = $client_input;
                break;
            case $this->lookupNamespace('raws') . ':' . 'transc'; 
                $transc = new Rats_Extension_Transc();
                $transc->transferFromDOM($child);
                $this->_transc = $transc;
                break;
            case $this->lookupNamespace('raws') . ':' . 'transc_media'; 
                $transc_media = new Rats_Extension_TranscMedia();
                $transc_media->transferFromDOM($child);
                $this->_transc_media = $transc_media;
                break;
            case $this->lookupNamespace('raws') . ':' . 'video_bitrate'; 
                $video_bitrate = new Rats_Extension_VideoBitrate();
                $video_bitrate->transferFromDOM($child);
                $this->_video_bitrate = $video_bitrate;
                break;
            case $this->lookupNamespace('raws') . ':' . 'audio_bitrate'; 
                $audio_bitrate = new Rats_Extension_AudioBitrate();
                $audio_bitrate->transferFromDOM($child);
                $this->_audio_bitrate = $audio_bitrate;
                break;
            case $this->lookupNamespace('raws') . ':' . 'video_height'; 
                $video_height = new Rats_Extension_VideoHeight();
                $video_height->transferFromDOM($child);
                $this->_video_height = $video_height;
                break;
            case $this->lookupNamespace('raws') . ':' . 'video_width'; 
                $video_width = new Rats_Extension_VideoWidth();
                $video_width->transferFromDOM($child);
                $this->_video_width = $video_width;
                break;
            case $this->lookupNamespace('raws') . ':' . 'proc'; 
                $proc = new Rats_Extension_Proc();
                $proc->transferFromDOM($child);
                $this->_proc = $proc;
                break;
            default:
                parent::takeChildFromDOM($child);
                break;
        }
    }


    public function getId()
    {
        return $this->_id;
    }

    public function setId($value)
    {
        $this->_id = $value;
        return $this;
    }
    
    public function getStatus()
    {
        return $this->_status;
    }

    public function setStatus($value)
    {
        $this->_status = $value;
        return $this;
    }

    public function getInput()
    {
        return $this->_input;
    }

    public function setInput($value)
    {
        $this->_input = $value;
        return $this;
    }

    public function getOutput()
    {
        return $this->_output;
    }

    public function setOutput($value)
    {
        $this->_output = $value;
        return $this;
    }

    public function getFormat()
    {
        return $this->_format;
    }

    public function setFormat($value)
    {
        $this->_format = $value;
        return $this;
    }

    public function getSrcLocation()
    {
        return $this->_src_location;
    }

    public function setSrcLocation($value)
    {
        $this->_src_location = $value;
        return $this;
    }

    public function getImportLocation()
    {
        return $this->_import_location;
    }

    public function setImportLocation($value)
    {
        $this->_import_location = $value;
        return $this;
    }

    public function getTgtLocation()
    {
        return $this->_tgt_location;
    }

    public function setTgtLocation($value)
    {
        $this->_tgt_location = $value;
        return $this;
    }

    public function getStartpos()
    {
        return $this->_startpos;
    }

    public function setStartpos($value)
    {
        $this->_startpos = $value;
        return $this;
    }

    public function getEndpos()
    {
        return $this->_endpos;
    }

    public function setEndpos($value)
    {
        $this->_endpos = $value;
        return $this;
    }

    public function getClientPassthru()
    {
        return $this->_client_passthru;
    }

    public function setClientPassthru($value)
    {
        $this->_client_passthru = $value;
        return $this;
    }

    public function getClientInput()
    {
        return $this->_client_input;
    }

    public function setClientInput($value)
    {
        $this->_client_input = $value;
        return $this;
    }

    public function getTransc()
    {
        return $this->_transc;
    }

    public function setTransc($value)
    {
        $this->_transc = $value;
        return $this;
    }

    public function getTranscMedia()
    {
        return $this->_transc_media;
    }

    public function setTranscMedia($value)
    {
        $this->_transc_media = $value;
        return $this;
    }

    public function getVideoBitrate()
    {
        return $this->_video_bitrate;
    }

    public function setVideoBitrate($value)
    {
        $this->_video_bitrate = $value;
        return $this;
    }

    public function getAudioBitrate()
    {
        return $this->_audio_bitrate;
    }

    public function setAudioBitrate($value)
    {
        $this->_audio_bitrate = $value;
        return $this;
    }

    public function getVideoHeight()
    {
        return $this->_video_height;
    }

    public function setVideoHeight($value)
    {
        $this->_video_height = $value;
        return $this;
    }

    public function getVideoWidth()
    {
        return $this->_video_width;
    }

    public function setVideoWidth($value)
    {
        $this->_video_width = $value;
        return $this;
    }
  
    public function getProc()
    {
        return $this->_proc;
    }

    public function setProc($value)
    {
        $this->_proc = $value;
        return $this;
    }

}
